package jmine.tec.report.impl;

import java.io.Serializable;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;

import jmine.tec.report.api.ReportHeader;
import jmine.tec.report.api.table.ReportCell;

/**
 * Implementação padrão de cabeçalho de relatório.
 * 
 * @author lundberg
 */
public class ReportHeaderImpl implements ReportHeader, Serializable {

    private String title;

    private String fileName;

    private int parametersPerRow;

    private List<ReportCell> parameters;

    /**
     * Construtor
     */
    public ReportHeaderImpl() {
        this.parameters = new LinkedList<ReportCell>();
        this.parametersPerRow = 2;
    }

    /**
     * {@inheritDoc}
     */
    public void addParameter(ReportCell parameter) {
        this.parameters.add(parameter);
    }

    /**
     * {@inheritDoc}
     */
    public int getParametersPerRow() {
        return this.parametersPerRow;
    }

    /**
     * {@inheritDoc}
     */
    public List<ReportCell> getParameters() {
        return Collections.unmodifiableList(this.parameters);
    }

    /**
     * {@inheritDoc}
     */
    public String getTitle() {
        return this.title;
    }

    /**
     * {@inheritDoc}
     */
    public void setTitle(String title) {
        this.title = title;
    }

    /**
     * @param parametersPerRow the parametersPerRow to set
     */
    public void setParametersPerRow(int parametersPerRow) {
        this.parametersPerRow = parametersPerRow;
    }

    /**
     * {@inheritDoc}
     */
    public String getFileName() {
        return this.fileName;
    }

    /**
     * @param fileName the fileName to set
     */
    public void setFileName(String fileName) {
        this.fileName = fileName;
    }

    /**
     * {@inheritDoc}
     */
    public void clearParameters() {
        this.parameters.clear();
    }
}
